<?php

/**
 * Comision_compania filter form base class.
 *
 * @package    saveenergy
 * @subpackage filter
 * @author     0
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseComision_companiaFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'compania_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Compania'), 'add_empty' => true)),
      'tarifa_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tarifa'), 'add_empty' => true)),
      'consumoMin'  => new sfWidgetFormFilterInput(),
      'consumoMax'  => new sfWidgetFormFilterInput(),
      'zonaRatio'   => new sfWidgetFormFilterInput(),
      'producto'    => new sfWidgetFormFilterInput(),
      'importe'     => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'compania_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Compania'), 'column' => 'id')),
      'tarifa_id'   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Tarifa'), 'column' => 'id')),
      'consumoMin'  => new sfValidatorPass(array('required' => false)),
      'consumoMax'  => new sfValidatorPass(array('required' => false)),
      'zonaRatio'   => new sfValidatorPass(array('required' => false)),
      'producto'    => new sfValidatorPass(array('required' => false)),
      'importe'     => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('comision_compania_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Comision_compania';
  }

  public function getFields()
  {
    return array(
      'id'          => 'Number',
      'compania_id' => 'ForeignKey',
      'tarifa_id'   => 'ForeignKey',
      'consumoMin'  => 'Text',
      'consumoMax'  => 'Text',
      'zonaRatio'   => 'Text',
      'producto'    => 'Text',
      'importe'     => 'Text',
    );
  }
}
